package cn.livingCloud.entity.user;

import cn.livingCloud.utils.DateUtils;
import cn.livingCloud.utils.UuidGenerator;
import cn.livingCloud.wechat.protocol.WechatUserInfo;

import java.util.Date;

/**
 * 会员
 * 会员在用户关注,服务器接受到消息推送时创建
 * 会员在用户进行网页授权时,检查会员表中,如果没有此会员,则创建
 * 会员在扫描特定二维码的时候,检查会员表中,如果没有此会员,则创建会员(需要管理员审核)
 * Created by 唐旭 on 2015/12/23.
 */
public class Member extends WechatUserInfo {
    public static final String MEMBER_REALM = "member";

    private String uuid = UuidGenerator.generate();
    //是否启用
    private boolean state;
    //创建时间
    //yyyy-MM-dd HH:mm:ss
    private Date createTime = DateUtils.now();

    public Member() {
    }

    public Member(WechatUserInfo userInfo) {
        super(userInfo);
    }

    public String getUuid() {
        return uuid;
    }

    public Member setUuid(String uuid) {
        this.uuid = uuid;
        return this;
    }

    public boolean isState() {
        return state;
    }

    public Member setState(boolean state) {
        this.state = state;
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public Member setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    @Override
    public String toString() {
        return uuid;
    }
}
